Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parse_crowdsourcing_config default empty strings #149

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

oplatek
Copy link
Member

@oplatek oplatek commented Nov 6, 2024

Fixes the following error caused by non-complete campaign config (because it is outdated or human edited)

Traceback (most recent call last):
  File "/Users/oplatek/code/factgenie/venv/lib/python3.11/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oplatek/code/factgenie/venv/lib/python3.11/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oplatek/code/factgenie/venv/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oplatek/code/factgenie/venv/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oplatek/code/factgenie/factgenie/app.py", line 107, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/oplatek/code/factgenie/factgenie/app.py", line 297, in crowdsourcing_create
    config = crowdsourcing.parse_crowdsourcing_config(config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oplatek/code/factgenie/factgenie/crowdsourcing.py", line 259, in parse_crowdsourcing_config
    "annotators_per_example": int(config.get("annotatorsPerExample", 1)),
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 

@oplatek oplatek requested a review from kasnerz November 6, 2024 14:32
@kasnerz kasnerz merged commit fd2146f into release-1.0.0 Nov 8, 2024
1 of 2 checks passed
@oplatek oplatek deleted the fix-campaign-config-missing branch November 13, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants